package org.wukongcrm.controller;

import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.wukongcrm.domain.entity.Address;
import org.wukongcrm.domain.model.R;
import org.wukongcrm.service.AddressService;

import java.util.List;

/**
 * @author ZhongWang
 * @since 2025 03 28:10:20
 */
@RestController
@AllArgsConstructor
@RequestMapping("/address")
public class AddressController {

    private AddressService addressService;

    @GetMapping("/tree")
    public R<List<Address>> getAddressTree() {
        return R.success(addressService.getAddressTree());
    }
}
